package com.app.model.util;

/**
 * Created by Lichaojie on 2017/5/4. It's a beautiful day.
 */
public class UserWithScore implements Comparable<UserWithScore> {

    private long userId;
    private double score;

    public long getUserId() {
        return userId;
    }

    public UserWithScore setUserId(long userId) {
        this.userId = userId;
        return this;
    }

    public double getScore() {
        return score;
    }

    public UserWithScore setScore(double score) {
        this.score = score;
        return this;
    }

    @Override
    public int compareTo(UserWithScore userWithScore){
        double score = userWithScore.getScore();
        if(this.score - score > 0){
            return 1;
        }else if(this.score - score < 0){
            return -1;
        }else{
            return 0;
        }
    }
}
